package murcielago;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.TextBox;
import javax.microedition.midlet.MIDlet;

public class Main extends MIDlet implements CommandListener {
    private Command exitCommand;
    private Display display;

    public void startApp() {

        display=Display.getDisplay(this);

        exitCommand=new Command("Salir",Command.EXIT, 2);
        TextBox textArea = new TextBox("Murcielago", "", 256, 0);

        textArea.addCommand(exitCommand);
        textArea.setCommandListener(this);

        display.setCurrent(textArea);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command c, Displayable d) {
        if (c==exitCommand){
            destroyApp(false);
            notifyDestroyed();
        }
    }

}